package com.dao.imp;

import java.util.Date;
import java.util.List;

import org.hibernate.Query;

import com.dao.SyllabusinfoDao;
import com.dao.core.DaoBaseImp;
import com.pojo.Syllabusinfo;
import com.util.TimeParse;

public class SyllabusinfoDaoImp extends DaoBaseImp<Syllabusinfo> implements SyllabusinfoDao{

	@Override
	public List<Syllabusinfo> getSyllabusinfoByDate(Date beginDate,Date endDate) {
		int beginWeekDay =TimeParse.getWeekDay(beginDate);
		int endWeekDay = TimeParse.getWeekDay(endDate);
		return null;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Syllabusinfo> getSyllabusinfoByRoomId(Integer id) {
		String hql="from Syllabusinfo as si where si.roomId=:roomId";
		Query query = getSession().createQuery(hql);
		return query.setInteger("roomId", id).list();
		
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Syllabusinfo> getSyllabusinfoByRoomIdAndWeekDay(Integer id,
			int weekday) {
		String hql="from Syllabusinfo as si where sr.RoomId=:roomId and weekday=:weekday";
		Query query = getSession().createQuery(hql);
		query.setInteger("weekday", weekday);
		return query.setInteger("roomId", id).list();
		
	}

	@Override
	public List<Syllabusinfo> getSyllabusinfo(Integer roomId, int weekday,
			Date beginDate, Date endDate) {
		List<Syllabusinfo> list =this.getSyllabusinfoByRoomIdAndWeekDay(roomId, weekday);
		
		return null;
	}
	

}
